import javax.swing.*;

/**
 * ****************************************************************************
 * $Author: Yegor Chemisov $
 * $Revision: 1.8 $
 * ****************************************************************************
 */

public class StartGame
{

    public static JFrame mainFrame;
    public static MemoryBoard board;

    /**
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
     */
    private static void createAndShowGUI()
    {

    /*
        //Use the Java look and feel.
        try {
            UIManager.setLookAndFeel(
                UIManager.getCrossPlatformLookAndFeelClassName());
        } catch (Exception e) { }

        //Make sure we have nice window decorations.
        JFrame.setDefaultLookAndFeelDecorated(true);
        JDialog.setDefaultLookAndFeelDecorated(true);
    */

        mainFrame = new JFrame(MAPConsts.RES.getString(GlobalRes.PROGRAMM_TITLE));

        //Create a new instance of Game.
        board = new MemoryBoard();

        //Create and set up the window.
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setJMenuBar((new MainMenu()).createMenuBar(board));
        mainFrame.setContentPane(board.getMainPanel());

        //Display the window.
        mainFrame.pack();
        mainFrame.setResizable(false);
        mainFrame.setVisible(true);
    }

    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}
